import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    { path: '/login', component: () => import('@/views/login/index.vue') },

    {
      path: '/',
      redirect: 'home',
      component: () => import('@/views/layout/index.vue'),
      children: [
        {
          path: 'home',
          component: () => import('@/views/home/index.vue'),
        },
        {
          path: 'user',
          component: () => import('@/views/user/index.vue'),
          // 隐藏该页面
          meta: {
            hideInMenu: true,
          },
        },
        {
          path: 'article',
          component: () => import('@/views/article/index.vue'),
        },
        {
          path: 'publish',
          component: () => import('@/views/publish/index.vue'),
        },
      ],
    },
  ],
})

export default router
